package com.xpgk.mvc.statistic.dailyTotalStatistic;

import java.util.List;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.xpgk.mvc.base.BaseController;
import com.xpgk.mvc.bentryRegister.Customer;
import com.xpgk.mvc.bentryRegister.CustomerDetail;
import com.xpgk.mvc.binShopService.CustomerService;
import com.xpgk.mvc.organization.Organization;

public class DailyTotalStatisticController  extends  BaseController{
	
	private  DailyTotalStatisticServices   dailyTotalStatisticServices;
	
	public  void  index()
	{	
		String organids = getCUserOrganIds();
		Organization  organ = Organization.dao.findById(organids);
		setAttr("organization", organ);
		render("dailyTotalStatistic.html");
	}
	@Before({Tx.class })
	public  void  getDailyTotal()
	{
		String month = getPara("month");
		String organids = getPara("organIds");
		String sql  = "SELECT *,(xgkdcjs-xgkzcjs ) as xgksjdc from  sb_customer_total_daily  WHERE  organids = ?  AND  date LIKE ? ORDER BY date";
		List<DailyNursingTotal>  dntList =  DailyNursingTotal.dao.find(sql,organids,"%"+month+"%");
		
		//添加旧数据到日综合查询表
//		dailyTotalStatisticServices.saveOld();
		renderJson(dntList);
	}
	
	/**
	 * 查询门店经营日报表（弹窗）
	 * */
	public  void queryDaily()
	{	
		String  organids=getPara("organids");
		Organization org = Organization.dao.findById(organids);
		setAttr("organization", org);	
		render("/dlstasticinfo/dailytotal.html");
	}
	

}
